/**
 * @description 获取localStorage
 */
export function localGet(key) {
  const value = window.localStorage.getItem(key);
  try {
    return JSON.parse(window.localStorage.getItem(key));
  } catch (error) {
    return value;
  }
}

/**
 * @description 存储localStorage
 */
export function localSet(key, value) {
  window.localStorage.setItem(key, JSON.stringify(value));
}

/**
 * @description 清除localStorage
 */
export function localRemove(key) {
  window.localStorage.removeItem(key);
}

/**
 * @description 清除所有localStorage
 */
export function romoveAll() {
  window.localStorage.clear();
}
